﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace JohnnySins.Entities
{
    public class StarProfile
    {
        public int StarProfileId { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public string Gender { get; set; }
        public string Ethnicity { get; set; }
        public string CountryOfOrigin { get; set; }
        public string State { get; set; }
        public string PlaceOfBirth { get; set; }
        public string City { get; set; }
        public DateTime? DateOfBirth { get; set; }
        public string EyeColor { get; set; }
        public string HairColor { get; set; }
        public string Height { get; set; }
        public string Weight { get; set; }
        public string MyTwitter { get; set; }
        public string Website { get; set; }
        public string WebsiteTwitter { get; set; }
        public string Email { get; set; }
        public string Phone { get; set; }
        public string AuditionMessage { get; set; }
        public string MemberId { get; set; }
        public int? ContactPurposeId { get; set; }

        public int CountPhoto { get; set; }
        public int CountScene { get; set; }
        public int StarRank { get; set; }
        public int Likes { get; set; }
        public int Dislikes { get; set; }
        
        public string FullName
        {
            get
            {
                return FirstName + " " + LastName;
            }
        }

        public bool Selected { get; set; }

        public List<StarProfilePhoto> Photos { get; set; }
        public IEnumerable<StarProfileScene> Scenes { get; set; }
    }

    public class StarProfilePhoto
    {
        public int StarProfilePhotoId { get; set; }
        public int StarProfileId { get; set; }
        public string StarProfilePhotoTitle { get; set; }
        public string StarProfilePhotoFileName { get; set; }
        public bool IsActive { get; set; }
        public bool Selected { get; set; }

        public string PhysFileName
        {
            get
            {
                return StarProfilePhotoId.ToString() + "-" + StarProfilePhotoFileName;
            }
        }
        public string Status
        {
            get
            {
                return IsActive ? "Active" : "Deactivate";
            }
        }

        public string MimeType
        {
            get
            {
                string result = "";

                if (!string.IsNullOrEmpty(PhysFileName))
                {
                    string extFile = Path.GetExtension(PhysFileName);

                    if ((extFile == ".jpeg") || (extFile == ".jpg"))
                        result = "image/jpeg";
                    else if (extFile == ".bmp")
                        result = "image/bmp";
                    else if (extFile == ".png")
                        result = "image/png";
                    else if (extFile == ".gif")
                        result = "image/gif";
                }

                return result;
            }
        }
    }

    public class StarProfileScene
    {
        public int StarProfileSceneId { get; set; }
        public int StarProfileId { get; set; }
        public string StarProfileSceneTitle { get; set; }
        public string PreviewFileName { get; set; }
        
        private string poster;
        public string Poster
        {
            get
            {
                return poster;
            }
            set
            {
                poster = value.Replace(' ', '-');
            }
        }

        public string HDWinFileName { get; set; }
        public string LDWinFileName { get; set; }
        public string HDQTFileName { get; set; }
        public string LDQTFileName { get; set; }

        public int Likes { get; set; }
        public int Dislikes { get; set; }

        public bool IsActive { get; set; }
        public bool Selected { get; set; }
        public string Status
        {
            get
            {
                return IsActive ? "Active" : "Deactivate";
            }
        }

        public string PhysFileName
        {
            get
            {
                return StarProfileSceneId.ToString() + "-" + PreviewFileName;
            }
        }
        public string PhysPoster
        {
            get
            {
                return StarProfileSceneId.ToString() + "-" + Poster;
            }
        }
        public string PhysHDWinFileName
        {
            get
            {
                return StarProfileSceneId.ToString() + "-" + HDWinFileName;
            }
        }
        public string PhysLDWinFileName
        {
            get
            {
                return StarProfileSceneId.ToString() + "-" + LDWinFileName;
            }
        }
        public string PhysHDQTFileName
        {
            get
            {
                return StarProfileSceneId.ToString() + "-" + HDQTFileName;
            }
        }
        public string PhysLDQTFileName
        {
            get
            {
                return StarProfileSceneId.ToString() + "-" + LDQTFileName;
            }
        }

    }

    [Serializable()]
    public class StarProfileSearchResult
    {
        public int StarProfileId { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public string FullName
        {
            get
            {
                return FirstName + " " + LastName;
            }
        }

        public int StarProfileSceneId { get; set; }
        public string StarProfileSceneTitle { get; set; }
        public string PreviewFileName { get; set; }
        public string Poster { get; set; }

        public string PhysFileName
        {
            get
            {
                return StarProfileSceneId.ToString() + "-" + PreviewFileName;
            }
        }
        public string PhysPoster
        {
            get
            {
                return StarProfileSceneId.ToString() + "-" + Poster;
            }
        }

    }

    public class Alphabet
    {
        public string Value { get; set; }
        public bool Selected { get; set; }
    }
}
